#ifndef SimpleHashTable_First
#define SimpleHashTable_First
#ifdef __GNUG__
#pragma interface
#endif

#include "HashTable.h"
#include "Container.h"

//---- SimpleHashTable ---------------------------------------------------------

class SimpleHashTable: public HashTable {
public:
	MetaDef(SimpleHashTable);

	SimpleHashTable(pEqualFunc eq, pHashFunc hs, pHashFunc exhs,
				pEqualFunc exef, int initCap= cContainerInitCap);
	~SimpleHashTable();
	
	void *ExtKeyFind(void *p);
	void Empty(int newCapacity= cContainerInitCap);
	void FreeAll();
	void *LinearSearch(void *p);

protected:
	//---- table primitives ----
	virtual void *KeyAt(int i);
	virtual void SetKeyAt(void *obj, int i);
	virtual void NullAt(int i);
	virtual void Swap(int i, int j);
	
	virtual HashTable *MakeNew(int initCap);
	virtual void Assign(HashTable *ht);
	
private:
	Object **tab;
	pHashFunc extKeyHash;
	pEqualFunc extKeyEqual;
};

#endif

